package com.henghong.risk.controller;

import com.henghong.risk.dto.ProjectListDTO;
import com.henghong.risk.result.Result;
import com.henghong.risk.service.ProjectListService;
import com.henghong.risk.vo.ProjectListVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/project")
@Slf4j
@Api(tags = "対象案件一覧")
public class ProjectListController {

    @Autowired
    private ProjectListService projectListService;

    /**
     * 从菜单画面点击“対象案件一覧”按钮，查询所有目标案件信息
     *
     * @param projectListDTO
     * @return
     */
    @GetMapping("/btnPjSearchClick")
    @ApiOperation(value = "対象案件信息取得")
    public Result<List<ProjectListVo>> btnPjSearchClick(ProjectListDTO projectListDTO) {
        log.info("対象案件信息查询");
        List<ProjectListVo> projectListVoList = projectListService.btnPjSearchClick(projectListDTO);
        return Result.success(projectListVoList);
    }
}
